package com.ssy.lingxi.platform.template.service.controller.adorn;

import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.template.service.entity.adorn.AppAdorn;
import com.ssy.lingxi.platform.template.service.model.dto.adorn.AppAdornDTO;
import com.ssy.lingxi.platform.template.service.model.dto.common.TemplateIdDTO;
import com.ssy.lingxi.platform.template.service.service.adorn.AppSelfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 模板装修 - APP自营装修
 * @author fhj
 * @version 2.0.0
 * @date 2021/10/14
 */
@Api(tags = "模板装修 - APP自营装修")
@RestController
@RequestMapping("/template/adorn/appSelf")
public class AppSelfController extends BaseController {

    @Resource
    private AppSelfService appSelfService;

    @ApiOperation(value = "保存APP自营装修")
    @PostMapping("/save")
    public Wrapper<Void> save(@RequestBody @Valid AppAdornDTO dto) {
        return appSelfService.save(dto, getSysUser());
    }

    @ApiOperation(value = "获取APP自营装修")
    @GetMapping("/find")
    public Wrapper<AppAdorn> find(@Valid TemplateIdDTO dto) {
        return appSelfService.find(dto, getSysUser());
    }
}
